package com.naver.xml;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.net.HttpURLConnection;
import java.net.URL;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;

public class XmlToObject {
	private static final String AROUND_CATEGORY = "http://api.map.naver.com/api2/getAroundCategory.nhn?caller=panorama";

	public static void main(String[] args) throws IOException, ClassNotFoundException {
		URL url = new URL(AROUND_CATEGORY);
		HttpURLConnection connection = (HttpURLConnection)url.openConnection();
		XStream stream = new XStream(new DomDriver());
//		stream.alias("categories", Categories.class);
//		stream.alias("category", Category.class);
		Message message = new Message();
		FileInputStream fis = new FileInputStream("d:/temp/category.txt");
		stream.fromXML(fis, message);
		
		System.out.println("AAA");
	}
}
